import request from '@/utils/request'

// 查询公益捐助二维码列表
export function listActivity(query) {
  return request({
    url: '/Community/doActivity/list',
    method: 'get',
    params: query
  })
}

// 查询公益捐助二维码详细
export function getActivity(id) {
  return request({
    url: '/Community/doActivity/' + id,
    method: 'get'
  })
}

// 新增公益捐助二维码
export function addActivity(data) {
  return request({
    url: '/Community/doActivity',
    method: 'post',
    data: data
  })
}

// 修改公益捐助二维码
export function updateActivity(data) {
  return request({
    url: '/Community/doActivity',
    method: 'put',
    data: data
  })
}

// 删除公益捐助二维码
export function delActivity(id) {
  return request({
    url: '/Community/doActivity/' + id,
    method: 'delete'
  })
}

// 活动状态修改
export function changeAtcivityStatus(id, status) {
  const data = {
    id,
    status
  }
  return request({
    url: '/Community/doActivity/changeStatus',
    method: 'put',
    data: data
  })
}
